<template>
	<view class="container">
		<view class="header">
			<view :style="{ height: statusBarHeight }" class="uni-status-bar"></view>
			<view class="uni-nav-bar" :style="{ height: naviBarHeight }">
				<view class="uni-nav" @tap="back">
					<uni-icons color="#FCF9F9" type="back" size="24" />
				</view>
				<view class="list-text" v-for="(item,index) in navList" :key="index" :class="{active:current==index}" @tap="clickNav(index)">{{item}}</view>
			</view>
		</view>

		<view class="carousel-section">
			<swiper class="carousel" circular @change="swiperChange">
				<swiper-item v-for="(item, index) in info.gallery" :key="index" class="carousel-item" @click="navToDetailPage({title: '轮播广告'})">
					<image :src="item" mode="aspectFill" />
				</swiper-item>
			</swiper>

			<!-- 自定义swiper指示器 -->
			<view class="swiper-dots">
				<text class="num">{{swiperCurrent+1}}</text>
				<text class="sign">/</text>
				<text class="num">{{swiperLength}}</text>
			</view>
		</view>

		<!-- 规格 -->
		<view id="block1">

			<view class="introduce-section">
				<text class="title">{{info.name}}</text>
				<view class="price-box">
					<text class="price">¥{{info.retailPrice}}</text>
					<text class="m-price">¥{{info.counterPrice}}</text>
					<text class="bot-row">已售{{info.salesNum}}{{info.unit}}</text>
				</view>
			</view>

			<view class="c-list">
				<view class="c-row b-b">
					<text class="tit">规格</text>
					<view class="con">
						<text class="selected-text">{{specifications}}</text>
					</view>
					<!-- <text class="yticon icon-you"></text> -->
				</view>
				<view class="c-row b-b">
					<text class="tit">运费</text>
					<text class="con t-r">免运费(偏远地区不包邮)</text>
					<text class="yticon icon-you"></text>
				</view>
				<view class="c-row b-b" @click="toggleSpec1">
					<text class="tit">说明</text>
					<view class="con explain-wrap">
						<view class="explain">
							<image class="expain-img" src="/static/img/pub/product_particulars_explain.png" mode=""></image>
							<text>24小时发货</text>
						</view>
						<view class="explain">
							<image class="expain-img" src="/static/img/pub/product_particulars_explain.png" mode=""></image>
							<text>不支持7天无理由退换</text>
						</view>
					</view>
					<text class="yticon icon-you"></text>
				</view>
				<view class="c-row b-b" @click="toggleSpec2">
					<text class="tit">服务</text>
					<view class="bz-list con">
						<image class="expain-img" src="/static/img/pub/product_particulars_ying.png" mode=""></image>
						<text>由钱颜发货并提供售后</text>
					</view>
					<text class="yticon icon-you"></text>
				</view>
			</view>

		</view>

		<!-- 评价 -->
		<view class="eva-section" id="block2">
			<view class="e-header">
				<view class="tit">评价({{count}})</view>
				<view class="comment-url" @click="navTo">
					<text class="tip">全部评价</text>
					<text class="yticon icon-you"></text>
				</view>
			</view>

			<view class="eva-box" v-for="item in comment" :key="index">
				<image class="portrait" v-show="item.avatar == ''" src="http://img3.imgtn.bdimg.com/it/u=1150341365,1327279810&fm=26&gp=0.jpg" mode="aspectFill"></image>
				<image class="portrait" v-show="item.avatar != ''" :src="item.avatar" mode="aspectFill"></image>
				<view @click="navTo" class="right">
					<text class="name" v-show="item.nickname != ''">{{item.nickname}}</text>
					<view class="bot">
						<view class="star">
							<tui-rate :current="item.star"></tui-rate>
						</view>
						<text class="time">{{item.addTime}}</text>
					</view>
					<view class="con">
						<text>{{item.content}}</text>
						<view class="con-imgs">
							<image v-for="img in item.picList" :key="index" :src="img"></image>
						</view>
					</view>

				</view>
			</view>

		</view>

		<!-- 详情 -->
		<view class="detail-desc" id="block3">
			<view class="d-header">
				<text>图文详情</text>
			</view>
			<view class="detailImg" v-html="info.detail"></view>
			<!-- <view class="detailImg" v-html="info.detail.replace(/\<img/gi, '<img style="max-width:100%;height:auto" ');"></view> -->
		</view>

		<view class="no-data">
			<p>~没有更多内容~</p>
		</view>

		<!-- 底部操作菜单 -->
		<view class="page-bottom">
			<a class="p-b-btn" href="tel:4001661880">
				<image src="/static/img/pub/customer.png" mode=""></image>
				<text>客服电话</text>
			</a>
			<view class="action-btn-group">
				<button type="primary" class=" action-btn no-border buy-now-btn" @click="buy">立即购买</button>
			</view>
		</view>

		<!-- 规格-模态层弹窗 -->
		<view class="popup spec" :class="specClass" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content" @click.stop="stopPrevent">
				<view class="a-t">
					<image class="pro-img" :src="info.picUrl"></image>
					<view class="right">
						<image @click="closeProp" class="close" src="/static/img/pub/product_particulars_close.png"></image>
						<view class="title">{{info.name}}</view>
						<view class="price">¥{{info.retailPrice}}</view>
						<view class="stock">库存：{{stock}}件</view>
					</view>
				</view>

				<!-- <view v-for="(item,index) in specList" :key="index" class="attr-list">
					<text>{{item.name}}</text>
					<view class="item-list">
						<text v-for="(childItem, childIndex) in specChildList" v-if="childItem.pid === item.id" :key="childIndex" class="tit"
						 :class="{selected: childItem.selected}" @click="selectSpec(childIndex, childItem.pid)">
							{{childItem.name}}
						</text>
					</view>
				</view> -->

				<view v-for="(item,index) in specificationList" :key="index" class="attr-list">
					<text>{{item.name}}</text>
					<view class="item-list">

						<text class="tit selected" v-for="(childItem, childIndex) in item.valueList" :key="childIndex" @click="selectSpec(childIndex,childItem.id)">
							{{childItem.value}}
						</text>

					</view>
				</view>



				<view class="num-list">
					<text class="attr-number">数量</text>
					<tui-numberbox class="step" :min="1" :max="10" :value="value" @change="change"></tui-numberbox>
				</view>

				<button class="btn" @click="buy">立即购买</button>
			</view>
		</view>

		<!-- 说明-模态层弹窗 -->
		<view class="popup spec" :class="specClass1" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec1">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content b-attr-content" @click.stop="stopPrevent">
				<view class="b-t">
					<image @click="closeProp1" class="close" src="/static/img/pub/product_particulars_close.png"></image>
					<view class="explain-title">说明</view>
				</view>
				<view class="b-attr-list">
					<view class="explain-list" v-for="(item,index) in explainList" :key="index">
						<image src="/static/img/pub/product_particulars_explain.png" mode=""></image>
						<text>{{item}}</text>
					</view>
				</view>

			</view>
		</view>

		<!-- 服务-模态层弹窗 -->
		<view class="popup spec" :class="specClass2" @touchmove.stop.prevent="stopPrevent" @click="toggleSpec2">
			<!-- 遮罩层 -->
			<view class="mask"></view>
			<view class="layer attr-content b-attr-content" @click.stop="stopPrevent">
				<view class="b-t">
					<image @click="closeProp2" class="close" src="/static/img/pub/product_particulars_close.png"></image>
					<view class="explain-title">服务</view>
				</view>
				<view class="b-attr-list">
					<view class="service">由钱颜发货并提供服务</view>
					<view class="service">根据国家工商总局《网络交易管理办法》要求对 网店营业执照信息公示如下：</view>
				</view>

			</view>
		</view>

		<!-- 右边菜单 -->
		<view class="right-menu">
			<image @click="toShare" src="/static/img/pub/product_particulars_share.png" mode=""></image>
			<!-- <image @click="toTransmit" src="/static/img/pub/product_particulars_transmit.png" mode=""></image> -->
			<image v-show="btnFlag" @click="toTop" src="/static/img/pub/product_particulars_top.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex';
	import share from '@/components/share';
	import uniNumberBox from '@/components/uni-number-box.vue';
	import uniIcons from "@/components/uni-icons/uni-icons.vue";
	var statusBarHeight = uni.getSystemInfoSync().statusBarHeight + 'px'
	export default {
		components: {
			share,
			uniNumberBox,
			uniIcons
		},
		data() {
			return {
				statusBarHeight: statusBarHeight,
				titleHeight: "64px", //状态栏和导航栏的总高度
				naviBarHeight: 44, //导航栏高度
				navList: ["商品", "评价", "详情"],
				current: 0,
				specClass: 'none',
				specClass1: 'none',
				specClass2: 'none',
				swiperCurrent: 0,
				swiperLength: 0,
				carouselList: [],
				favorite: true,
				shareList: [],
				specSelected: [],
				specifications:"",
				specList: [
					{
						id: 1,
						name: '规格',
					},
					{
						id: 2,
						name: '类型',
					},
				],
				specChildList: [
					{
						id: 1,
						pid: 1,
						name: '一盒',
					},
					{
						id: 2,
						pid: 2,
						name: '清润补水型',
					},
					{
						id: 3,
						pid: 2,
						name: '深度滋养型',
					},
					{
						id: 4,
						pid: 2,
						name: '光润亮肤型',
					}
				],
				explainList: ["正品保障", "精选无忧·质量保证 购物无忧", '不支持7天无理由退换', '24小时发货'],
				btnFlag: false,
				info: {},
				specificationList: {},
				productList: [],
				comment: {},
				count: "",
				current: 0,
				value: 1,
				goodsId: "",
				userId: "",
				stock: "0", // 库存
				productId:"",    //商品id
			};
		},

		// 页面滚动执行方式
		onPageScroll(res) {
			// 监听滚动事件，获取滚动条的当前位置
			// 当距离大于120时显示回到顶部按钮
			if (res.scrollTop > 220) {
				this.btnFlag = true
			} else {
				this.btnFlag = false
			};
		},

		async onLoad(options) {
			//获取用户信息
			let userinfo = uni.getStorageSync("userInfo")
			
			this.userId = userinfo.id

			//获取商品id
			this.goodsId = options.id;

			//详情数据
			this.loadData();

			//微信分享弹出框数据
			this.shareList = await this.$api.json('shareList');

			//规格 默认选中第一条
			// this.specList.forEach(item => {
			// 	for (let cItem of this.specChildList) {
			// 		if (cItem.pid === item.id) {
			// 			this.$set(cItem, 'selected', true);
			// 			console.log(cItem)
			// 			this.specSelected.push(cItem);
			// 			break; 				
			// 		}
			// 	}
			// })
		},

		computed: {
			...mapState(['hasLogin'])
		},

		mounted() {
			var query = uni.createSelectorQuery();
			// 获取对应模块到顶部的距离
			query.select('#block1').boundingClientRect((res) => {
				this.block_1ScrollTop = res.top
			}).exec()
			query.select('#block2').boundingClientRect((res) => {
				this.block_2ScrollTop = res.top
			}).exec()
			query.select('#block3').boundingClientRect((res) => {
				this.block_3ScrollTop = res.top
			}).exec()
		},

		methods: {
			// 返回上级页面
			back() {
				uni.navigateBack()
			},

			// 轮播图切换
			swiperChange(e) {
				const index = e.detail.current;
				this.swiperCurrent = index;
			},

			// 详情
			loadData() {
				this.tui.request(
					'/app/goods/detail',
					'GET', {
						id: this.goodsId,
					},
					false,
					false,
					false,
				).then(res => {
					if (res.errno == 0) {
						this.info = res.data.info;
						if (this.info.gallery.length) {
							this.swiperLength = this.info.gallery.length;
						}
						this.productList = res.data.productList
						this.specificationList = res.data.specificationList
						this.comment = res.data.comment.data;
						this.count = res.data.comment.count;
							
						if(this.productList){
							this.stock = this.productList[0].number
							this.productId = this.productList[0].id
							
							if(this.productList[0].specifications){
								this.specifications = this.productList[0].specifications[0]
							}
						}
						
						
					}
				}).catch(err => {
					console.log(err)
				})
			},

			// 规格弹窗开关
			toggleSpec() {
				if (this.specClass === 'show') {
					this.specClass = 'hide';
					setTimeout(() => {
						this.specClass = 'none';
					}, 250);
				} else if (this.specClass === 'none') {
					this.specClass = 'show';
				}
				
				this.stock = this.productList[0].number
				this.productId = this.productList[0].id
				this.specifications = this.productList[0].specifications[0]
			},

			// 点x关闭弹框
			closeProp() {
				if (this.specClass === 'show') {
					this.specClass = 'hide';
					setTimeout(() => {
						this.specClass = 'none';
					}, 250);
				} else if (this.specClass === 'none') {
					this.specClass = 'show';
				}
			},

			// 说明弹窗开关
			toggleSpec1() {
				if (this.specClass1 === 'show') {
					this.specClass1 = 'hide';
					setTimeout(() => {
						this.specClass1 = 'none';
					}, 250);
				} else if (this.specClass1 === 'none') {
					this.specClass1 = 'show';
				}
			},

			// 点x关闭弹框
			closeProp1() {
				if (this.specClass1 === 'show') {
					this.specClass1 = 'hide';
					setTimeout(() => {
						this.specClass1 = 'none';
					}, 250);
				} else if (this.specClass1 === 'none') {
					this.specClass1 = 'show';
				}
			},

			// 说明弹窗开关
			toggleSpec2() {
				if (this.specClass2 === 'show') {
					this.specClass2 = 'hide';
					setTimeout(() => {
						this.specClass2 = 'none';
					}, 250);
				} else if (this.specClass2 === 'none') {
					this.specClass2 = 'show';
				}
			},

			// 点x关闭弹框
			closeProp2() {
				if (this.specClass2 === 'show') {
					this.specClass2 = 'hide';
					setTimeout(() => {
						this.specClass2 = 'none';
					}, 250);
				} else if (this.specClass2 === 'none') {
					this.specClass2 = 'show';
				}
			},

			// 选择规格
			// selectSpec(index, pid) {
			// 	let list = this.specChildList;
			// 	list.forEach(item => {
			// 		if (item.pid === pid) {
			// 			this.$set(item, 'selected', false);
			// 		}
			// 	})

			// 	this.$set(list[index], 'selected', true);

			// 	this.specSelected = [];
			// 	list.forEach(item => {
			// 		if (item.selected === true) {
			// 			this.specSelected.push(item);
			// 		}
			// 	})
			// },
			
			selectSpec(index, pid) {
				console.log(index)
				console.log(pid)
				
				let list = this.productList[0];
				this.stock = this.productList[0].number
				this.productId = this.productList[0].id
				
				this.specifications = this.productList[0].specifications[0]
				
				

			},

			// 购买数量
			change: function(e) {
				this.value = e.value;
				console.log(this.value)
			},

			// 立即购买
			buy: function() {
				let _this = this;
				
				// //#ifdef H5
				// 	this.tui.toast("请下载APP进行购买")
				// 	return
				// //#endif

				if (!_this.hasLogin) {
					uni.navigateTo({
						url: '/pages/public/login'
					})
				} else {
					// _this.specClass = 'hide';
					_this.tui.request('/app/cart/fastadd', 'POST', {
								goodsId: _this.goodsId,
								productId: _this.productId,
								number: _this.value,
								userId: _this.userId,
							},
							false, false, false, )
						.then(res => {
							if (res.errno == 0) {
								// _this.specClass = 'none';
								let cartId = res.data.cartId
								uni.navigateTo({
									url: `/pages/order/createOrder?cartId=${cartId}&userId=${_this.userId}`
								})
							} else {
								console.log(res)
								_this.tui.toast(res.errmsg)
							}
						}).catch(err => {
							console.log(err)
						})
				}



			},

			stopPrevent() {

			},

			// 回到顶部
			toTop() {
				uni.pageScrollTo({
					scrollTop: 0,
					duration: 300
				});
			},

			// 分享
			toShare() {
				if (!this.hasLogin) {
					uni.navigateTo({
						url: '/pages/public/login'
					})
				} else {
					uni.navigateTo({
						url: `/pages/product/share?id=${this.goodsId}`
					})
				}
				
			},

			// 转发
			toTransmit() {
				uni.navigateTo({
					url: '/pages/product/forward'
				})
			},

			// 全部评价
			navTo() {
				uni.navigateTo({
					url: `/pages/product/comment?id=${this.goodsId}`
				})
			},

			// 头部切换
			clickNav(index) {
				// this.isList = false
				// this.navIcon = true
				this.current = index
				console.log(this.current)
				if (index == 0) {
					uni.pageScrollTo({
						scrollTop: 0,
						duration: 300
					});
				}
				if (index == 1) {
					uni.pageScrollTo({
						scrollTop: this.block_2ScrollTop,
						duration: 300
					})
				}
				if (index == 2) {
					uni.pageScrollTo({
						scrollTop: this.block_3ScrollTop + 360,
						duration: 300
					})
				}


			},
		},
	}
</script>

<style lang='scss'>
	page {
		background: rgba(250, 250, 250, 1);
		padding-bottom: 106upx;
	}

	/deep/ img {
		width: 100%;
	}

	.header {
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10000;

		$nav-height: 44px;

		.uni-status-bar {
			width: 750rpx;
			height: 20px;
			background-color: #D14798;
			/* height: var(--status-bar-height); */
		}

		.uni-nav-bar {
			position: relative;

			.uni-nav {
				position: absolute;
				left: 0;
				top: 0;
				width: 15upx;
				height: 25upx;
				color: #fff;

			}

			/* #ifndef APP-NVUE */
			display: flex;
			justify-content: center;
			/* #endif */
			flex-direction: row;
			width: 750rpx;
			height: $nav-height;
			line-height: $nav-height;
			background-color: #D14798;

			.list-text {
				font-size: 32upx;
				color: #FCF9F9;
				font-weight: 400;

				&:nth-of-type(2n) {
					margin: 0 25upx;
				}
			}

			.active {
				font-size: 36upx;
				font-weight: bold;
			}
		}
	}



	.icon-you {
		font-size: 28upx;
		color: #999;
	}

	/* 头部 轮播图 */
	.carousel-section {
		position: relative;
		margin-top: 88upx;
		/* #ifdef APP-PLUS */
		padding-top: var(--status-bar-height);
		/* #endif */

		.titleNview-placing {
			/* #ifdef APP-PLUS */
			padding-top: var(--status-bar-height);
			/* #endif */
			margin-top: 88upx;
			box-sizing: content-box;
		}

		.titleNview-background {
			position: absolute;
			top: 0;
			left: 0;
			width: 100%;
			height: 460upx;
			transition: .4s;
		}
	}

	.carousel {
		width: 100%;
		height: 740upx;

		.carousel-item {
			width: 100%;
			height: 100%;
			overflow: hidden;
		}

		image {
			width: 100%;
			height: 100%;
		}
	}

	uni-swiper-dot {
		width: 37px !important;
		height: 4px !important;
		border-radius: inherit !important;
		background-color: #cccccc !important;
	}

	/* 自定义点点 */
	.swiper-dots {
		display: flex;
		justify-content: center;
		position: absolute;
		right: 30upx;
		bottom: 18upx;
		width: 65upx;
		height: 32upx;
		font-size: 20upx;
		color: #fff;
		text-align: center;
		line-height: 32upx;
		border-radius: 50upx;
		background: rgba(0, 0, 0, .5);
		// background-image: url();
		/* background-size: 100% 100%; */

		.num {
			width: 36upx;
			height: 36upx;
			/*border-radius: 50px; */
			font-size: 24upx;
			color: #fff;
			text-align: center;
			line-height: 36upx;
		}

		.sign {
			position: absolute;
			top: 0;
			left: 50%;
			line-height: 36upx;
			font-size: 12upx;
			color: #fff;
			transform: translateX(-50%);
		}
	}

	/* 标题简介 */
	.introduce-section {
		background: #fff;
		padding: 30upx 30upx 15upx;
		border-bottom: 6upx solid #fafafa;

		.title {
			font-size: 32upx;
			color: #333;
			height: 50upx;
			line-height: 50upx;

		}

		.price-box {
			height: 90upx;
			padding: 27upx 0 0;
			color: #D14798;
		}

		.price {
			color: #D14798;
			font-size: 38upx;
		}

		.m-price {
			margin: 0 12upx;
			color: #999;
			font-size: 24upx;
			text-decoration: line-through;
		}

		.coupon-tip {
			align-items: center;
			padding: 4upx 10upx;
			background: $uni-color-primary;
			font-size: $font-sm;
			color: #fff;
			border-radius: 6upx;
			line-height: 1;
			transform: translateY(-4upx);
		}

		.bot-row {
			float: right;
			font-size: 24upx;
			color: #999;
		}
	}

	/* 分享 */
	.share-section {
		display: flex;
		align-items: center;
		color: $font-color-base;
		background: linear-gradient(left, #fdf5f6, #fbebf6);
		padding: 12upx 30upx;

		.share-icon {
			display: flex;
			align-items: center;
			width: 70upx;
			height: 30upx;
			line-height: 1;
			border: 1px solid $uni-color-primary;
			border-radius: 4upx;
			position: relative;
			overflow: hidden;
			font-size: 22upx;
			color: $uni-color-primary;

			&:after {
				content: '';
				width: 50upx;
				height: 50upx;
				border-radius: 50%;
				left: -20upx;
				top: -12upx;
				position: absolute;
				background: $uni-color-primary;
			}
		}

		.icon-xingxing {
			position: relative;
			z-index: 1;
			font-size: 24upx;
			margin-left: 2upx;
			margin-right: 10upx;
			color: #fff;
			line-height: 1;
		}

		.tit {
			font-size: $font-base;
			margin-left: 10upx;
		}

		.icon-bangzhu1 {
			padding: 10upx;
			font-size: 30upx;
			line-height: 1;
		}

		.share-btn {
			flex: 1;
			text-align: right;
			font-size: $font-sm;
			color: $uni-color-primary;
		}

		.icon-you {
			font-size: $font-sm;
			margin-left: 4upx;
			color: $uni-color-primary;
		}
	}

	.c-list {
		font-size: 32upx;
		color: #999;
		background: #fff;

		.c-row {
			display: flex;
			align-items: center;
			padding: 30upx;
			position: relative;
		}

		.tit {
			width: 80upx;
		}

		.con {
			flex: 1;
			color: #333;
			font-size: 32upx;
			margin-left: 100upx;

			.selected-text {
				margin-right: 10upx;
			}
		}

		.explain-wrap {
			display: flex;

			.explain {
				font-size: 24upx;
				color: #333;
				margin-right: 20upx;
			}

			.expain-img {
				display: inline-block;
				width: 24upx;
				height: 24upx;
				margin-right: 10upx;
			}
		}

		.bz-list {
			font-size: 28upx;
			line-height: 32upx;
			color: #333;
			line-height: 32upx;

			.expain-img {
				width: 28upx;
				height: 32upx;
				margin-right: 10upx;
				vertical-align: middle;
			}

		}

		.con-list {
			flex: 1;
			display: flex;
			flex-direction: column;
			color: $font-color-dark;
			line-height: 40upx;
		}

		.red {
			color: $uni-color-primary;
		}
	}

	/* 评价 */
	.eva-section {
		display: flex;
		flex-direction: column;
		padding: 20upx 30upx;
		background: #fff;
		margin-top: 16upx;

		.e-header {
			display: flex;
			align-items: center;
			justify-content: space-between;
			height: 70upx;
			font-size: $font-sm + 2upx;
			color: $font-color-light;

			.tit {
				font-size: 32upx;
				color: #333;
				margin-right: 4upx;
			}

			.tip {
				flex: 1;
				text-align: right;
			}

			.comment-url {
				float: right;
			}

			.icon-you {
				margin-left: 10upx;
			}
		}
	}

	.eva-box {
		display: flex;
		padding: 20upx 0;

		.portrait {
			flex-shrink: 0;
			width: 56upx;
			height: 56upx;
			border-radius: 50%;
		}

		.right {
			flex: 1;
			display: flex;
			flex-direction: column;
			font-size: $font-base;
			color: $font-color-base;
			padding-left: 10upx;

			.attr {
				font-size: 20upx;
				margin: 10upx 0;
			}

			.name {
				font-size: 28upx;
				color: #333232;
			}

			.con {
				text {
					font-size: 28upx;
					color: #333232;
					margin: 10upx 0;
				}

				.con-imgs {
					width: 100%;
					overflow: hidden;

					image {
						float: left;
						width: 190upx;
						height: 190upx;
						margin-top: 16upx;
						margin-right: 21upx;

						&:nth-of-type(3n) {
							margin-right: 0;
						}
					}
				}
			}

			.bot {
				display: flex;
				justify-content: space-between;
				font-size: $font-sm;
				color: $font-color-light;

				.star {
					display: flex;

					image {
						width: 24upx;
						height: 24upx;
						margin-right: 6upx;
					}
				}
			}
		}
	}

	/*  详情 */
	.detail-desc {
		background: #fff;
		margin-top: 16upx;
		width: 100%;

		.d-header {
			height: 80upx;
			line-height: 80upx;

			text {
				padding: 0 20upx;
				font-size: 32upx;
				color: #333;
				font-weight: bold;
			}
		}

		image {
			display: block;
			width: 100%;
			height: 1010px;
		}


	}

	/* 规格选择弹窗 */
	.attr-content {
		padding: 10upx 30upx;

		.a-t {
			display: flex;
			justify-content: space-between;

			.pro-img {
				width: 200upx;
				height: 200upx;
				flex-shrink: 0;
				margin-top: 30upx;
			}

			.right {
				width: 464upx;
				position: relative;
				margin-left: 24upx;
				font-size: $font-sm + 2upx;
				color: $font-color-base;
				line-height: 42upx;
				margin-top: 30upx;

				.close {
					float: right;
					width: 29upx;
					height: 29upx;
				}

				.title {
					overflow: hidden;
					text-overflow: ellipsis;
					white-space: nowrap;
					color: #333333;
					font-size: 32upx;
					font-weight: 500;
					line-height: 42upx;
					margin-top: 60upx;

				}

				.stock {
					color: #999999;
					font-size: 24upx;
					line-height: 39upx;
				}

				.price {
					font-size: 38upx;
					color: #D14798;
					line-height: 40upx;
					margin-top: 30upx;
				}

				.selected-text {
					margin-right: 10upx;
				}
			}
		}

		.attr-list {
			display: flex;
			flex-direction: column;
			font-size: $font-base + 2upx;
			color: $font-color-base;
			padding-top: 30upx;
			padding-left: 10upx;
		}

		.num-list {
			display: flex;
			align-items: center;
			justify-content: space-between;
			font-size: $font-base + 2upx;
			color: $font-color-base;
			padding-top: 30upx;
			padding-left: 10upx;

		}

		.uni-numbox {
			position: initial;
			left: 0;
			bottom: 0;
		}

		.item-list {
			padding: 20upx 0 0;
			display: flex;
			flex-wrap: wrap;

			text {
				display: flex;
				align-items: center;
				justify-content: center;
				margin-right: 60upx;
				margin-bottom: 20upx;
				border-radius: 30upx;
				padding: 12upx 30upx;
				font-size: 32upx;
				color: #333333;
				border: 1px solid #E6E6E6;
			}

			.selected {
				color: #6E609E;
				border: 1px solid #6E609E;
			}
		}
	}

	/* 说明弹出层 */
	.b-attr-content {
		padding: 30upx 30upx 10upx;
		position: relative;

		.b-t {
			.close {
				position: absolute;
				top: 30upx;
				right: 30upx;
				width: 29upx;
				height: 29upx;
			}

			.explain-title {
				text-align: center;
				color: #999999;
				font-size: 36upx;
				line-height: 40upx;
			}
		}

		.b-attr-list {
			.service {
				color: #333333;
				font-size: 32upx;
				color: rgba(51, 51, 51, 1);
				margin-bottom: 40upx;

				&:nth-of-type(1) {
					margin-top: 40upx;
				}
			}

			.explain-list {
				display: flex;
				margin-bottom: 40upx;

				image {
					width: 34upx;
					height: 34upx;
					margin-right: 20upx;
				}

				text {
					font-size: 32upx;
					color: rgba(51, 51, 51, 1);
					line-height: 39upx;
				}
			}
		}
	}

	/*  弹出层 */
	.popup {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		z-index: 99;

		&.show {
			display: block;

			.mask {
				animation: showPopup 0.2s linear both;
			}

			.layer {
				animation: showLayer 0.2s linear both;
			}
		}

		&.hide {
			.mask {
				animation: hidePopup 0.2s linear both;
			}

			.layer {
				animation: hideLayer 0.2s linear both;
			}
		}

		&.none {
			display: none;
		}

		.mask {
			position: fixed;
			top: 0;
			width: 100%;
			height: 100%;
			z-index: 1;
			background-color: rgba(0, 0, 0, 0.4);
		}

		.layer {
			position: fixed;
			z-index: 99;
			bottom: 0;
			width: 100%;
			min-height: 40vh;
			border-radius: 10upx 10upx 0 0;
			background-color: #fff;

			.btn {
				width: 690upx;
				height: 90upx;
				line-height: 90upx;
				/* background: linear-gradient(0deg, rgba(110, 96, 158, 0.8), rgba(149, 126, 224, 0.8)); */
				background-color: #D14798;
				border-radius: 45upx;
				font-size: 32upx;
				font-weight: 500;
				color: #fff;
				margin: 30upx auto 20upx;
			}
		}

		@keyframes showPopup {
			0% {
				opacity: 0;
			}

			100% {
				opacity: 1;
			}
		}

		@keyframes hidePopup {
			0% {
				opacity: 1;
			}

			100% {
				opacity: 0;
			}
		}

		@keyframes showLayer {
			0% {
				transform: translateY(120%);
			}

			100% {
				transform: translateY(0%);
			}
		}

		@keyframes hideLayer {
			0% {
				transform: translateY(0);
			}

			100% {
				transform: translateY(120%);
			}
		}
	}

	/* 底部操作菜单 */
	.page-bottom {
		position: fixed;
		left: 0upx;
		bottom: 0upx;
		z-index: 95;
		display: flex;
		justify-content: center;
		align-items: center;
		width: 100%;
		height: 106upx;
		background: rgba(255, 255, 255, 1);
		box-shadow: 0px 1px 8px 0px rgba(0, 0, 0, 0.3);


		.p-b-btn {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			font-size: $font-sm;
			color: $font-color-base;
			text-decoration: none;

			image {
				width: 38upx;
				height: 38upx;
			}

			text {
				font-size: 20upx;
				margin-top: 10upx;
			}
		}

		.action-btn-group {
			width: 527upx;
			height: 70upx;
			overflow: hidden;
			border-radius: 35px;
			margin-left: 60upx;

			.action-btn {
				height: 100%;
				line-height: 70upx;
				font-size: 28upx;
				padding: 0;
				border-radius: 0;
				/* background: linear-gradient(0deg, rgba(110, 96, 158, 0.8), rgba(149, 126, 224, 0.8)); */
				background-color: #D14798;
			}
		}
	}

	/* 右侧菜单 */
	.right-menu {
		position: fixed;
		right: 30upx;
		top: 70%;

		image {
			display: block;
			width: 60upx;
			height: 60upx;
			margin-bottom: 10upx;
		}
	}

	/* 暂无数据 */
	.no-data {
		font-size: 24upx;
		line-height: 40upx;
		padding: 60upx 0;
		text-align: center;
		color: #CCCCCC;
	}
</style>
